import type { TableProps } from 'antd';
import { Button, Table } from 'antd';
import React from 'react';

const columns: TableProps<any>['columns'] = [
  {
    title: '时间',
    dataIndex: 'time',
    key: 'time',
  },
  {
    title: '名称',
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '地区',
    dataIndex: 'area',
    key: 'area',
  },
  {
    title: '详细地址',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: '案件类型',
    dataIndex: 'caseType',
    key: 'caseType',
  },
  {
    title: '案件详情',
    dataIndex: 'caseDetail',
    key: 'caseDetail',
    render: () => {
      return <Button type="primary">查看</Button>;
    },
  },
];

const App: React.FC = ({ data }: any) => (
  <Table pagination={false} columns={columns} dataSource={data} />
);

export default App;
